Link Module strategy

I've adopted the following strategy vis-a-vis link-modules and the code that determines whether a link is in that link module.

[1] ALL link modules go in a project top-level folder "Link Modules". Since there is a small finite number of different relationships between objects there is a small finite number of corresponding link modules; some project may have as many as 10.

[2] All links of a relationship are placed in that link module

[3] My include files can then define known relationships along with the name of the link module that represents that relationship, e.g. "Allocation_Links".

[4] Attr-DXL code can become generic, where the name of the attrDXLName can indicate the kind of relationship, and therefore the name of the corresponding link module.

[5] Generic code that loops through links look like this:

if     (attrDXLName includes "Allocation") then NameLM_Desired = "Allocation_Links"
elseif(attrDXLName includes "Satisfies")  then NameLM_Desired = "Tracability_Links"
elseif(attrDXLName includes "Tests")    then NameLM_Desired = "Verification_Links"
else error; halt
 
for lnk in obj->"*" do    // get all outlinks
{  NameLM_Actual = module(lnk)   // base name
   if (NameLM_Actual != NameLM_Desired) then continue
   oTarget = target(lnk)
   bufResults += info about oTarget
}
obj.attrDXLName = tempStringOf(bufResults)


[6] Note that the above does NOT attempt to use the loop to filter out the link module:

 

  • for lnk in obj->NameLinkMod_Desired do // get just links I care about

I found that too difficult, since the name is a function of the name of the project, and other reasons.

-Louie

 


llandale - Thu Mar 28 11:25:52 EDT 2013